<template>
  <div class="hello">
    <input v-model="parentMsg" placeholder="请输入内容" />
    <br /><br />
    <p>{{ parentMsg }}</p>
    <button @click="clearMessage">清空</button>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data() {
    return {
      parentMsg: ''
    }
  },
  methods: {
    clearMessage() {
      this.parentMsg = ''
    }
  }
}
</script>


<style scoped>
.hello {
  margin: 20px;
}
input {
  padding: 6px;
  font-size: 16px;
  width: 200px;
}
button {
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
}
</style>
